package net.wanho.service.impl;

import net.wanho.entity.Student;
import net.wanho.exception.NameExistsException;
import net.wanho.service.StudentService;
import org.springframework.stereotype.Service;

/**
 * Author：汤小洋
 * Date：2025-06-30 10:46
 * Description：<描述>
 */
@Service
public class StudentServiceImpl implements StudentService {
    @Override
    public void add(Student stu) {
        /**
         * 判断用户名是否被占用
         */
        if ("tom".equals(stu.getName())){
            throw new NameExistsException("用户名已存在");
        }

        System.out.println("添加到数据库中......"+stu);

    }
}
